#region
/* Adoor.NET - Object/Relational mapping framework leveraging ADO.NET`s powerful disconnected mode.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *  
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *  
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */ 
#endregion

using System.ComponentModel;
//using Adoor.Object.Design;

namespace Adoor.Object.Domain
{
	/// <summary>
	/// <see cref="IObjectSource"/> objects reference one root <see cref="ObjectDomain"/> object (property <see cref="IObjectSource.RootDomain"/>)
	/// and optionally several child <see cref="ObjectDomain"/> objects (property <see cref="IObjectSource.ChildDomains"/>).
	/// Child domains are domains that are referenced by the root domain and whose entities may take part in the queries performed
	/// over the <see cref="IObjectSource"/>.
	/// </summary>
	//[TypeConverter(typeof(ChildDomainConverter))]
	public struct ChildDomain
	{
		private string domain;

		public ChildDomain(string domain)
		{
			this.domain = domain;
		}

		//[Editor(typeof(DomainEditor), typeof(UITypeEditor))]
		public string Domain
		{
			get { return this.domain; }
			set { this.domain = value; }
		}

		public override string ToString()
		{
			if (this.Domain != null && this.Domain != "")
				return this.Domain;
			else
				return base.ToString();
		}
	}
}